package me.jessyan.mvparms.demo.di.module.fragment;

import com.jess.arms.di.scope.FragmentScope;

import dagger.Module;
import dagger.Provides;

import me.jessyan.mvparms.demo.mvp.contract.fragment.ShoppingCardContract;
import me.jessyan.mvparms.demo.mvp.model.fragment.ShoppingCardModel;


@Module
public class ShoppingCardModule {
    private ShoppingCardContract.View view;

    /**
     * 构建ShoppingCardModule时,将View的实现类传进来,这样就可以提供View的实现类给presenter
     *
     * @param view
     */
    public ShoppingCardModule(ShoppingCardContract.View view) {
        this.view = view;
    }

    @FragmentScope
    @Provides
    ShoppingCardContract.View provideShoppingCardView() {
        return this.view;
    }

    @FragmentScope
    @Provides
    ShoppingCardContract.Model provideShoppingCardModel(ShoppingCardModel model) {
        return model;
    }
}